Agents as Tools
You can use Agents as Tools with a model. Each Agent can have it's own persona/prompt, Tools, Data Sources and other components, and can be used to hand-off complex workflows for additional capabilities. Agents as Tools can also be used to set Prompt Variables in the inner agent and pass run-time values for the Agent to execute.
Before you start
Make sure you have an Agent you want to use, and an API Key that is scoped to your project. To create an API Key, go to Settings -> API Key, and save it before starting.
Setting up an Agent as a Tool
To add an Agent as a Tool, look for it in the Tool Library.
The Tool can be added via finding it from the library listing.
Add the Tool to your library.
Provide an Agent by selecting it from the available options.
Create a new Credential or select an existing credential with your API Key. When selecting "Create a New Credential", you will be prompted to provide your API Key. Provide this under as your Header Value:
Once saved, add the tool to an agent by following the Tools setup guide.
Prompt Variables
Agents as Tools support passing of values to Prompt Variables to the inner Agent. In the example below, we can see an Agent that has Prompt Variables included for 2 fields.
When adding this Agent as a Tool, you'll see that the Tool will automatically fetch the variables associated with this Agent.
The model will set these variables when it's being called and set them from the user's response.
For improved responses, it is recommended that you add a prompt to your model as well, providing details of your Agentic use case.